<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>练习background-clip</title>
  <style>
    /* 
      background-clip 
      背景图片截取，默认是外边距为界限，内边距以外的将被截取掉，不进行显示
      有三个参数分别为
      border-box 从外边框以外的将被截取掉
      border-padding 从内边距以外的将被截取掉
      border-content 从内容以外的将被截取掉
     */
  div{
    background: url('../../img/a.png') no-repeat;
    width: 100px;
    height: 100px;
    padding: 40px;
    border: 50px dashed #ccc;
    display: inline-block;
    margin-right: 20px;
  }
  .bgImg1 {
    background-origin: border-box;
  }
  .bgImg2 {
    background-clip: padding-box;
  }
  .bgImg3 {
    background-clip: content-box;
  }
  </style>
</head>
<body>
  <div class="bgImg1"></div>
  <div class="bgImg2"></div>
  <div class="bgImg3"></div>
</body>
</html>